class {
    onMount() {
        this.events = [];
    }

    handleAttach(color, event, node) {
        this.events.push({
            color: color,
            event: event,
            node: node
        });
    }
}

<ul>
    <color-include>
        <if(input.color === "blue")>
            <li.color on-attach("handleAttach", input.color)>blue</li>
        </if>
        <else-if(input.color === "green")>
            <li.color on-attach("handleAttach", input.color)>green</li>
        </else-if>
        <else>
            <li.color on-attach("handleAttach", input.color)>
                ${input.color}
            </li>
        </else>
    </color-include>
</ul>